﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example13.aspx.cs" Inherits="Chapter11.Example13" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 11-13 使用 col 元素</title>
    <meta name="author" content="Adam Freeman" />
    <meta name="description" content="A simple example" />
    <link rel="shortcut icon" href="Example01.Favicon.ico" type="image/x-ico" />
    <style>
        thead th, tfoot th {
            text-align: left;
            background: grey;
            color: white;
        }

        tbody th {
            text-align: right;
            background: lightgrey;
            color: grey;
        }

        [colspan], [rowspan] {
            font-weight: bold;
            border: medium solid black;
        }

        thead [colspan], tfoot [colspan] {
            text-align: center;
        }

        caption {
            font-weight: bold;
            font-size: large;
            margin-bottom: 5px;
        }

        #colgroup1 {
            background-color: red;
        }

        #col3 {
            background-color: green;
            font-size: small;
        }
    </style>
</head>
<body>
    <form>
        <div>
            <table>
                <caption>Results of the 2011 Fruit Survey</caption>
                <colgroup id="colgroup1">
                    <col id="col1And2" span="2" />
                    <col id="col3" />
                </colgroup>
                <colgroup id="colgroup2" span="2" />
                <thead>
                    <tr>
                        <th id="rank">Rank</th>
                        <th id="name">Name</th>
                        <th id="color">Color</th>
                        <th id="sizeAndVotes" colspan="2">Size & VOtes</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <th>2nd Favorite:</th>
                        <td>Orages</td>
                        <td>Orage</td>
                        <td>Large</td>
                        <td>450</td>
                    </tr>
                    <tr>
                        <th>3rd Favorite:</th>
                        <td>Pomegranate</td>
                        <td colspan="2" rowspan="2">Pomegranates and cherries can both come in a range of colors</td>
                        <td>203</td>
                    </tr>
                    <tr>
                        <th rowspan="2">Joint 4th:</th>
                        <td>Cherries</td>
                        <td rowspan="2">75</td>
                    </tr>
                    <tr>
                        <td>Pineapple</td>
                        <td>Brown</td>
                        <td>Very Large</td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <th colspan="5">&copy; 2011 Adam Freeman Fruit Data Enterprises</th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </form>
</body>
</html>
